/* 文章详情页面样式 */

/* 头部导航 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background-color: var(--white-color);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--light-gray);
}

.back-btn {
    font-size: 22px;
    color: var(--text-color);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-title {
    font-size: 17px;
    font-weight: 600;
    flex: 1;
    text-align: center;
    margin: 0;
}

.action-btns {
    display: flex;
    align-items: center;
    font-size: 20px;
    color: var(--text-color);
}

.action-btns i {
    margin-left: 15px;
    cursor: pointer;
}

/* 文章头部 */
.article-header {
    padding: 15px;
    background-color: var(--white-color);
}

.article-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.author-info {
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.author-data {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 3px;
}

.publish-time {
    font-size: 12px;
    color: var(--gray-color);
}

.follow-btn {
    background-color: rgba(63, 81, 181, 0.1);
    color: var(--primary-color);
    border: none;
    border-radius: 15px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.follow-btn:hover {
    background-color: rgba(63, 81, 181, 0.2);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
}

.article-tag {
    background-color: var(--light-gray);
    color: var(--gray-color);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 5px;
}

/* 文章内容 */
.article-content {
    background-color: var(--white-color);
    padding: 15px;
    margin-bottom: 15px;
}

.article-banner {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

.content-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-color);
}

.content-text h2 {
    font-size: 19px;
    font-weight: 600;
    margin: 25px 0 15px;
    color: var(--dark-color);
}

.content-text h2:first-child {
    margin-top: 0;
}

.content-text h3 {
    font-size: 17px;
    font-weight: 500;
    margin: 20px 0 10px;
    color: var(--dark-color);
}

.content-text p {
    margin-bottom: 15px;
}

.content-text ul, .content-text ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.content-text li {
    margin-bottom: 8px;
}

/* 相关推荐 */
.related-articles {
    background-color: var(--white-color);
    padding: 15px;
    margin-bottom: 15px;
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.article-item {
    display: flex;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.article-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-img {
    flex: 0 0 100px;
    height: 80px;
}

.article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    flex: 1;
    padding: 10px;
    margin-bottom: 0;
}

.article-content h3 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    font-size: 12px;
    color: var(--gray-color);
}

/* 评论区 */
.comments-section {
    background-color: var(--white-color);
    padding: 15px;
    margin-bottom: 15px;
    padding-bottom: 80px; /* 为底部导航留出空间 */
}

.comment-count {
    font-size: 14px;
    font-weight: normal;
    color: var(--gray-color);
}

.comment-list {
    margin-bottom: 20px;
}

.comment-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--light-gray);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-user {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.comment-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 2px;
}

.comment-time {
    font-size: 12px;
    color: var(--gray-color);
}

.comment-content {
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.5;
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--gray-color);
}

.like-btn, .reply-btn {
    margin-right: 15px;
    cursor: pointer;
}

.like-btn i {
    margin-right: 3px;
}

/* 回复列表 */
.reply-list {
    margin-top: 10px;
    padding-left: 46px;
    border-left: 2px solid var(--light-gray);
}

.reply-item {
    padding-top: 10px;
}

/* 评论输入框 */
.comment-input {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.input-container {
    flex: 1;
    display: flex;
    align-items: center;
    background-color: var(--light-gray);
    border-radius: 20px;
    padding: 5px 15px;
}

.comment-input input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 14px;
    outline: none;
}

.send-btn {
    background-color: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    margin-left: 10px;
}

/* 为iPhone 15进行适配 */
@media screen and (width: 390px) and (height: 844px) {
    .header {
        padding-top: calc(15px + var(--iphone-safe-area-top));
    }
    
    .article-title {
        font-size: 20px;
    }
    
    .author-avatar {
        width: 38px;
        height: 38px;
    }
    
    .content-text {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .content-text h2 {
        font-size: 18px;
    }
    
    .content-text h3 {
        font-size: 16px;
    }
    
    .comment-input {
        padding-bottom: calc(10px + var(--iphone-safe-area-bottom));
    }
}

/* 小屏设备适配 */
@media (max-width: 320px) {
    .article-title {
        font-size: 18px;
    }
    
    .author-avatar {
        width: 36px;
        height: 36px;
    }
    
    .article-img {
        flex: 0 0 90px;
    }
    
    .content-text {
        font-size: 14px;
    }
    
    .content-text h2 {
        font-size: 17px;
    }
    
    .content-text h3 {
        font-size: 15px;
    }
}

/* 暗黑模式支持 */
@media (prefers-color-scheme: dark) {
    .article-title, .author-name, .user-name, .content-text {
        color: #e0e0e0;
    }
    
    .follow-btn {
        background-color: rgba(63, 81, 181, 0.2);
    }
    
    .article-tag {
        background-color: #333;
    }
    
    .comment-item {
        border-bottom-color: #333;
    }
    
    .reply-list {
        border-left-color: #333;
    }
    
    .input-container {
        background-color: #333;
    }
    
    .comment-input input::placeholder {
        color: #999;
    }
    
    .content-text h2, .content-text h3, .section-title {
        color: #e0e0e0;
    }
} 